<template>
  <div class="zzc" v-show="props.flag">
    <div class="warn" v-show="props.flag">
      <p>是否保存修改</p>
      <div class="anniu">
        <div class="qx" @click="qx">取消</div>
        <div class="qr" @click="qr">确认</div>
      </div>
    </div>
  </div>
</template>

<script setup>
const emit = defineEmits(['qx', 'qr'])
const props = defineProps({
  flag: {
    type: Boolean
  }
})
// 点击取消按钮
const qx = () => {
  emit('qx')
}
// 点击确认按钮
const qr = () => {
  emit('qr')
}
</script>

<style lang="scss" scoped>
.zzc {
  top: 0;
  left: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
}

.warn {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -35px;
  margin-left: -135px;
  width: 270px;
  height: 102px;
  background-color: #000;
  font-size: 18px;

  p {
    height: 60px;
    width: 100%;
    line-height: 60px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
  }

  .anniu {
    height: 42px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    color: rgba(255, 255, 255, 0.3);

    .qx {
      text-align: center;
    }
  }
}
</style>